home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The X-Philes (2nd Revision)
/
The X-Philes Number 1 (1995).iso
/
xphiles
/
hp48_1
/
pubdom.tar
/
pubdom
/
e_vogel
/
temps.doc
< prev
next >
Wrap
Text File
|
1990-05-21
|
10KB
|
287 lines
TEMPERATURE ADDITION AND SUBTRACTION PROGRAMS FOR ENGINEERING USE
Physical laws involving temperature units are generally derived using absolute
temperature units (Kelvin and Rankine). These temperature units can be
manipulated like any other physical units (they have multiplicative conversion
factors), and obey the standard rules of arithmetic. However, it is common in
engineering to express temperatures in what we might call "thermometer" units,
i.e., degrees Celsius and degrees Fahrenheit. These units, because of the
additive constants included in their definitions, do not obey arithmetic rules.
Standard engineering practice interprets these thermometer temperatures in one
of two ways: as a point on a temperature scale (i.e., 20 degrees Fahrenheit),
or as a temperature increment along a scale (i.e., 20 Fahrenheit degrees). The
specific interpretation depends on the context of the operation being
performed. Adding a temperature increment to a point on a temperature scale
yields a new point on the scale; subtracting two points on a temperature scale
yields a temperature increment. While temperature points have an additive
relationship (1.8 times a point on the Celsius scale, plus 32 gives a point on
the Fahrenheit scale), temperature increments have a multiplicative
relationship (a Fahrenheit degree is 1.8 times a Celsius degree).
Thermometer units do not fit well within the HP 48 unit management system,
which is designed for units with purely multiplicative conversion factors and
which satisfy arithmetic rules. To partially accomodate thermometer units, the
48 does the following:
When CONVERT is applied to a "pure temperature" (a unit object whose unit
part is one of the four temperature units), the conversion accounts for the
additive constants. This allows CONVERT, including the automatic CONVERT
built into the TEMP menu keys, to be used for simple temperature conversions.
Multiplying or dividing pure temperatures treats thermometer units as
absolute units. This extends to addition and subtraction of any compound
units that include temperature units.
When adding or subtracting (and numerical =) two pure temperatures, the 48
has no way to make a context-sensitive interpretation of a point versus an
increment -- the temperatures are always treated as points on a scale. Both
arguments are converted to absolute temperature units before the addition or
subtraction occurs, and the result is converted to the units of the second
argument (level 1). While this scheme ensures that addition and subtraction
are commutative, it means that computing with temperature increments in
thermometer units will generally not give directly usable results.
These conventions mean that many common engineering formulas written in terms
of thermometer units can not be used directly on the HP 48. There are two
alternatives to adapt such equations:
1. Use absolute temperature units only.
2. Substitute alternate functions for arithmetic operators.
This document describes two user programs that support the second approach:
INCT, which adds an increment to a point on a temperature scale, and DELTAT,
which subtracts two points on a temperature scale (equivalent to TINC and
TDELTA in the HP 82211A HP Solve Equation Library Application Card). Here are
the specific situations in which INCT and DELTAT can be used:
1. Add a temperature increment to a point on a temperature scale
Result: new point on a temperature scale
2. Subtract a temperature increment from a point on a temperature scale
Result: new point on a temperature scale
3. Subtract two points on a temperature scale from each other
Result: temperature increment
4. Add two temperature increments together
Result: temperature increment
5. Subtract two temperature increments from each other
Result: temperature increment
Here are sample keystrokes for the above situations:
Operation Keystrokes Result
-----------------------------------------------------------------
1. temppt1+tempinc temppt1 ENTER tempinc INCT temppt2
2. temppt1-tempinc temppt1 ENTER tempinc CHS INCT temppt2
3. temppt2-temppt1 temppt2 ENTER temppt1 DELTAT tempinc
4. tempinc1+tempinc2 tempinc1 ENTER tempinc2 INCT tempinc
5. tempinc2-tempinc1 tempinc2 ENTER tempinc1 CHS INCT tempinc
INCT and DELTAT expect two unit objects containing only pure temperatures, but
will also calculate + and - for real numbers. If you want them to error on all
argument types other than these, call VFTOBJ or VFTERR as shown in the program
comments (this will double execution time). INCT and DELTAT can also be used
in algebraics (i.e., 'DELTAT(Tfinal,Tinitial)').
Terminology:
N(unit_obj): the numeric part of the unit_obj
U(unit_obj): the unit part of the unit_obj
temppt1, temppt1', temppt2: points on a temperature scale
tempinc1, tempinc2: temperature increments
INCT Adds a point on a temperature scale to a temperature increment.
To subtract a temperature increment from a point on a temperature scale,
negate the increment and use INCT to add.
2: temppt1
1: tempinc --> 1: temppt2
Algorithm:
IF
tempinc and temppt1 are on the same absolute temperature scales
(i.e., combinations of F and F, F and R, C and C, or C and K)
THEN
temppt2 has value N(temppt1) + N(tempinc)
and units U(temppt1) (note the level 2 units)
IF
tempinc and temppt1 are NOT on the same absolute temperature scales
(i.e., combinations of F and C, F and K, R and C, or R and K)
THEN
temppt2 has value N(temppt1) + N(tempinc)*scalefactor
and units U(temppt1)
where scalefactor is 1.8 if temppt1 is F or R
or 1/1.8 if temppt1 is C or K
Examples:
a. 2: 400_R
1: 40_F --> 1: 440_R
b. 2: 40_F
1: 400_R --> 1: 440_F (= 900_R)
c. 2: 40_F
1: 10_C --> 1: 58_F (40_F + 10 * 1.8)
d. 2: 10_C
1: 40_F --> 1: 32.2_C (= 90_F)
(10_C + 40 * 1/1.8)
DELTAT Subtracts two points on a temperature scale, yielding a
temperature increment.
2: temppt2
1: temppt1 --> 1: tempinc
Algorithm:
temppt1 is converted to temppt1' with units of temppt2
tempinc has value N(temppt2) - N(temppt1')
and units U(temppt2) (note the level 2 units)
Examples:
a. 2: 400_R
1: 40_F (500_R) --> 1: -100_R
b. 2: 40_F
1: 400_R (-60_F) --> 1: 100_F (= 560_R)
c. 2: 40_F
1: 10_C (50_F) --> 1: -10_F (40_F - 50_F)
d. 2: 10_C
1: 40_F (4.4_C) --> 1: 5.6_C (= 42_F) (10_C - 4.4_C)
To emphasize the differences between the different addition and subtraction
operations, here is a series of examples that illustrates these with units
on the same and different temperature scales.
Addition Operations, Same Temperature Scales
40_F 10_F + --> 510_F
10_F 40_F + --> 510_F
40_F 10_F INCT --> 50_F
10_F 40_F INCT --> 50_F
40_F 10_F CHS DELTAT --> 50_F
10_F 40_F CHS DELTAT --> 50_F
Addition Operations, Different Temperature Scales
40_F 10_C + --> 288_C
10_C 40_F + --> 550_F (= 288_C)
40_F 10_C INCT --> 58_F
10_C 40_F INCT --> 32_C (= 90_F)
40_F 10_C CHS DELTAT --> 26_F
10_C 40_F CHS DELTAT --> 50_C (= 122_F)
Subtraction Operations, Same Temperature Scales
40_F 10_F - --> -430_F
10_F 40_F - --> -490_F
40_F 10_F CHS INCT --> 30_F
10_F 40_F CHS INCT --> -30_F
40_F 10_F DELTAT --> 30_F
10_F 40_F DELTAT --> -30_F
Subtraction Operations, Different Temperature Scales
40_F 10_C - --> -279_C
10_C 40_F - --> -450_F (= -268_C)
40_F 10_C CHS INCT --> 22_F
10_C 40_F CHS INCT --> -12_C (= 10_F)
40_F 10_C DELTAT --> -10_F
10_C 40_F DELTAT --> 6_C (= 42_F)
The behavior is unexpected with identical temperatures, such as -40_F and
-40_C. This is especially true when one temperature is zero, as shown below:
Addition Operations, Same Temperature Scales
32_F 32_F + --> 524_F
32_F 32_F INCT --> 64_F
32_F 32_F CHS DELTAT --> 64_F
0_C 0_C + --> 273_C
0_C 0_C INCT --> 0_C
0_C 0_C DELTAT --> 0_C
Addition Operations, Different Temperature Scales
32_F 0_C + --> 273_C
0_C 32_F + --> 524_F (= 273_C)
32_F 0_C INCT --> 32_F
0_C 32_F INCT --> 18_C (= 64_F)
32_F 0_C DELTAT --> 0_F
0_C 32_F CHS DELTAT --> 36_C (= 97_F)
Subtraction Operations, Same Temperature Scales
32_F 32_F - --> -460_F
32_F 32_F CHS INCT --> 0_F
32_F 32_F DELTAT --> 0_F
0_C 0_C - --> -273_C
0_C 0_C INCT --> 0_C
0_C 0_C DELTAT --> 0_C
Subtraction Operations, Different Temperature Scales
32_F 0_C - --> -273_C
0_C 32_F - --> -460_F (= -273_C)
32_F 0_C INCT --> 32_F
0_C 32_F CHS INCT --> -18_C (= 0_F)
32_F 0_C DELTAT --> 0_F
0_C 32_F DELTAT --> 0_C (= 32_F)